package com.ios.service.impl;

import com.ios.mapper.SeatStatusMapper;
import com.ios.model.dto.SeatStatusDTO;
import com.ios.service.SeatStatusService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Date;
import java.util.List;

/**
 * 座位状态服务实现
 */
@Service
public class SeatStatusServiceImpl implements SeatStatusService {

    @Autowired
    private SeatStatusMapper seatStatusMapper;

    @Override
    public List<SeatStatusDTO> getSeatStatus(Long roomId, Date date, Integer timeSlot) {
        // 参数校验
        if (roomId == null || date == null || timeSlot == null) {
            throw new IllegalArgumentException("参数不能为空");
        }

        // 查询座位状态
        return seatStatusMapper.selectSeatStatus(roomId, date, timeSlot);
    }
}